<?
	/**** 0: Solo el body_main				1: Muestra solo el body_left		******/
	/**** 2: Muestra solo el body_right 	3: Muestra todo						******/
	global $aMenu;
	
	if ( $this->aDatos[$cTemplateId]['body_left']  )
	{
		echo "<div id='body_left' >";
		foreach ( $this->aDatos[$cTemplateId]['body_left']  as $aCelda) 
	{
			$cStyle =  $cClass =  '';
			if ( strpos( $aCelda[cClass], ';' ) > 0 ) 
				$cStyle =  " style='" . $aCelda[cClass] . "' ";
			elseif ( $aCelda[cClass] )
				$cClass =  " class=' " . $aCelda[cClass] . "' ";
			echo "<div $cClass  $cStyle >"; 
				$oModule =& loadModule($aCelda[cModulo]);
				$this->aDatos[$aCelda[ncOrden]][aCelda] = $aCelda;
				$oModule->showTemplatePage($aCelda[cAccion], $aCelda[ncOrden], $aCelda[cParametros] );
			echo "</div>";
		}
		echo "</div>";
	}
	global $aMenu;
	echo "<div id='body_main_" . $this->aDatos[$cTemplateId][nVista]  ."' >";
	$cTitulo = $this->aDatos[$cTemplateId][cTitulo]  ? $this->aDatos[$cTemplateId][cTitulo] : $aMenu[cdMenu] ;
	$cPath = $this->aDatos[$cTemplateId][cPath]  ? $this->aDatos[$cTemplateId][cPath] : $aMenu[cdSeccion]." ". $aMenu[dSubseccion]  ;
	if ( $this->aDatos[$cTemplateId][nVista] ) 
	{
		echo "	<div id='body_main_head'>";
		echo "		<div class='path_seccion'>". $cPath."</div>";
		echo "		<div class='titulo_seccion'>"  . $cTitulo . "</div>";
		if ( file_exists(URL_FILES."imagenes_menu/banner_".$aMenu[ncMenu].".jpg") )	echo	"<div style='margin-top:10px'><img src='".URL_FILES."imagenes_menu/banner_".$aMenu[ncMenu].".jpg' width='553' style='border:none' alt='"  . $aMenu[cdMenu] . "' /></div>";
		echo "	</div>";
		echo "<div id='body_main_contenido_" . $this->aDatos[$cTemplateId][nVista]  ."' >";
	}
	foreach ( $this->aDatos[$cTemplateId]['body_main']  as $aCelda) 
	{
		$cStyle =  $cClass =  '';	
		if ( strpos( $aCelda[cClass], ';' ) > 0 ) 
			$cStyle =  " style='" . $aCelda[cClass] . "' ";
		elseif ( $aCelda[cClass] )
			$cClass =  " class=' " . $aCelda[cClass] . "' ";
		echo "<div $cClass  $cStyle >"; 
			$oModule =& loadModule($aCelda[cModulo]);
			$this->aDatos[$aCelda[ncOrden]][aCelda] = $aCelda;
			$oModule->showTemplatePage($aCelda[cAccion], $aCelda[ncOrden], $aCelda[cParametros] );
		echo "</div>";
	}
	if ( $this->aDatos[$cTemplateId][nVista] ) 
		echo "</div>";
		
		
	// Panel derecho
	if ( $this->aDatos[$cTemplateId]['body_right']  )
	{
		echo "<div id='body_right' >";
		foreach ( $this->aDatos[$cTemplateId]['body_right']  as $aCelda) 
		{
			$cStyle =  $cClass =  '';
			if ( strpos( $aCelda[cClass], ';' ) > 0 ) 
				$cStyle =  " style='" . $aCelda[cClass] . "'";
			elseif ( $aCelda[cClass] )
				$cClass =  " class='" . $aCelda[cClass] . "'";
			echo "<div $cClass  $cStyle >"; 
				$this->aDatos[$aCelda[ncOrden]][aCelda] = $aCelda;
				$oModule =& loadModule($aCelda[cModulo]);
				$oModule->showTemplatePage($aCelda[cAccion], $aCelda[ncOrden], $aCelda[cParametros] );
			echo "</div>";
		}		
		echo "</div>";
	}
	echo "</div>";
	
	
?>